#include "junix.h"
using namespace std;

class Base
{
	public:
		Base();
		void hello();

	private:
		virtual void impl_hello()=0;
};

class D:public Base
{
	public:
		D();

	private:
		void impl_hello();
};



class E:public Base
{
	public:
		E();

	private:
		void impl_hello();
};

//===================================================
//     implements
//===================================================

Base::Base(){}
void Base::hello()
{
	impl_hello();
}

D::D(){}
void D::impl_hello()
{
	std::cout<<"D::impl_hello"<<std::endl;
}


E::E(){}
void E::impl_hello()
{
	std::cout<<"E::impl_hello"<<std::endl;
}


//====================================================
//
//====================================================

int main(int argc, char **argv)
{
	D d;
	E e;

	Base* b1 =&d;
	b1->hello();
	b1=&e;
	b1->hello();

}
